package com.idempotent.demo.service;

import java.util.Optional;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.idempotent.demo.entity.Order;
import com.idempotent.demo.repository.OrderRepository;

@Service
public class OrderService {
    

    @Autowired
    private OrderRepository orderRepository;



    public Order findByOrderNo(String orderNo) {
          Optional<Order> byOrderNo = orderRepository.findByOrderNo(orderNo);

          return byOrderNo.orElse(null);

    }



}
